3.1.32 \(\int \sin (e+f x) (a+b \tan ^2(e+f x)) \, dx\) [32]

Optimal. Leaf size=28 \[ -\frac {(a-b) \cos (e+f x)}{f}+\frac {b \sec (e+f x)}{f} \]

[Out]

-(a-b)*cos(f*x+e)/f+b*sec(f*x+e)/f

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3745, 14} \begin {gather*} \frac {b \sec (e+f x)}{f}-\frac {(a-b) \cos (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-(((a - b)*Cos[e + f*x])/f) + (b*Sec[e + f*x])/f

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3745

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m
 + 1)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \sin (e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac {\text {Subst}\left (\int \frac {a-b+b x^2}{x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \left (b+\frac {a-b}{x^2}\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {(a-b) \cos (e+f x)}{f}+\frac {b \sec (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 46, normalized size = 1.64 \begin {gather*} -\frac {a \cos (e) \cos (f x)}{f}+\frac {b \cos (e+f x)}{f}+\frac {b \sec (e+f x)}{f}+\frac {a \sin (e) \sin (f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[e + f*x]*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Cos[e]*Cos[f*x])/f) + (b*Cos[e + f*x])/f + (b*Sec[e + f*x])/f + (a*Sin[e]*Sin[f*x])/f

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 52, normalized size = 1.86

method result size
derivativedivides \(\frac {b \left (\frac {\sin ^{4}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )\right )-\cos \left (f x +e \right ) a}{f}\) \(52\)
default \(\frac {b \left (\frac {\sin ^{4}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )\right )-\cos \left (f x +e \right ) a}{f}\) \(52\)
risch \(-\frac {{\mathrm e}^{i \left (f x +e \right )} a}{2 f}+\frac {{\mathrm e}^{i \left (f x +e \right )} b}{2 f}-\frac {{\mathrm e}^{-i \left (f x +e \right )} a}{2 f}+\frac {{\mathrm e}^{-i \left (f x +e \right )} b}{2 f}+\frac {2 b \,{\mathrm e}^{i \left (f x +e \right )}}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) \(90\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(f*x+e)*(a+b*tan(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(b*(sin(f*x+e)^4/cos(f*x+e)+(2+sin(f*x+e)^2)*cos(f*x+e))-cos(f*x+e)*a)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 34, normalized size = 1.21 \begin {gather*} \frac {b {\left (\frac {1}{\cos \left (f x + e\right )} + \cos \left (f x + e\right )\right )} - a \cos \left (f x + e\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

(b*(1/cos(f*x + e) + cos(f*x + e)) - a*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]
time = 3.98, size = 33, normalized size = 1.18 \begin {gather*} -\frac {{\left (a - b\right )} \cos \left (f x + e\right )^{2} - b}{f \cos \left (f x + e\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-((a - b)*cos(f*x + e)^2 - b)/(f*cos(f*x + e))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \sin {\left (e + f x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*sin(e + f*x), x)

________________________________________________________________________________________

Giac [A]
time = 0.58, size = 41, normalized size = 1.46 \begin {gather*} b {\left (\frac {\cos \left (f x + e\right )}{f} + \frac {1}{f \cos \left (f x + e\right )}\right )} - \frac {a \cos \left (f x + e\right )}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

b*(cos(f*x + e)/f + 1/(f*cos(f*x + e))) - a*cos(f*x + e)/f

________________________________________________________________________________________

Mupad [B]
time = 11.78, size = 39, normalized size = 1.39 \begin {gather*} \frac {\left (\cos \left (e+f\,x\right )+1\right )\,\left (b-a\,\cos \left (e+f\,x\right )+b\,\cos \left (e+f\,x\right )\right )}{f\,\cos \left (e+f\,x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(e + f*x)*(a + b*tan(e + f*x)^2),x)

[Out]

((cos(e + f*x) + 1)*(b - a*cos(e + f*x) + b*cos(e + f*x)))/(f*cos(e + f*x))

________________________________________________________________________________________